<?php

namespace App\Models\Sys;

use Illuminate\Database\Eloquent\Model;
use App\Models\School;

class Child extends Model
{

    protected $table = 'jxt_sys_child';
    protected $primaryKey = 'child_id';

    const CREATED_AT = 'create_at';
    const UPDATED_AT = null;

    public function student()
    {
        return $this->belongsToMany(School\Student::class, 'jxt_school_child_student','child_id','student_id');
    }

    public function classes()
    {
        return $this->belongsToMany(School\Classes::class, 'jxt_school_student','student_id','class_id');
    }
}
